package com.ahcloud.edas.common.kafka.listener;

import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;

import java.io.Serializable;

/**
 * @program: edas-common
 * @description:
 * @author: YuKai Fan
 * @create: 2024/4/20 10:08
 **/
public interface MessageListener<K, V> extends Serializable {

    /**
     * 接收消息
     * @param consumer
     * @param messages
     */
    void received(KafkaConsumer<K, V> consumer, ConsumerRecords<K, V> messages);
}
